---
title: Assign and normalize a task due date
summary: Normalize a due date assignment to a working day per the configured modifier.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks
reference_type: embedded
operation_id: OP-5
trigger: Any assignment to TaskDate
---

# Assign and normalize a task due date

This operation runs whenever `TaskDate` is assigned, normalizing non-working-day dates to a working day according to the configured `TaskDateModifierType`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-5 |
| **Trigger** | Any assignment to `TaskDate` |
| **Inputs** | Candidate date, `TaskDateModifier` |
| **Outputs** | Normalized `TaskDate`, `TaskDateModified` flag |
| **Primary components** | `clsTask.AssignTaskDate` |
| **Entry point** | `SAIF.Business.Tasks/clsTask.vb` |

## Steps

1. Store the date and reset `TaskDateModified = False`.
2. If the date is neither `Date.MinValue` nor `Date.MaxValue`, branch on `TaskDateModifier`:
   - `CurrentDay`: no adjustment.
   - `NextWorkDay`: if not a working day, move to `m_TaskDate.NextWorkDay` and set `TaskDateModified`.
   - `PriorWorkDay` (default): if not a working day, step back one day at a time until a working day is found and set `TaskDateModified` ([BR-009](../business-rules.md#br-009-a-non-working-day-due-date-is-moved-to-a-working-day)).
   > **Origin**: Working-day determination (`clsSmartDate.IsWorkingDay` / `NextWorkDay`) is implemented in the SAIF BOF Framework and was not traced in this analysis pass.**
3. The `CheckDateModified` rule then raises a non-blocking warning when `TaskDateModified` is true ([BR-008](../business-rules.md#br-008-automatic-due-date-shifting-must-be-surfaced-as-a-warning)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([TaskDate assigned]) --> S1[Reset TaskDateModified]
	S1 --> D{"Date is MinValue or<br>MaxValue?"}
	D -->|Yes| EndNoAdj([No adjustment])
	D -->|No| M{TaskDateModifier}
	M -->|CurrentDay| EndNoAdj
	M -->|NextWorkDay| S2["Move to NextWorkDay if<br>needed"]
	M -->|PriorWorkDay| S3["Step back to prior working<br>day if needed"]
	S2 --> EndAdj([TaskDateModified set])
	S3 --> EndAdj
```

## Failure and edge-case behavior

- `Date.MinValue`/`Date.MaxValue` sentinel values bypass normalization entirely (used to represent "no date").
- Automatic shifting is surfaced only as a non-blocking warning, not a save-blocking error ([BR-008](../business-rules.md#br-008-automatic-due-date-shifting-must-be-surfaced-as-a-warning)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- SAIF.Business.Tasks/clsTask.vb
